<?php
    class member{
        private $memID;

        public function __construct() {
            $args = func_get_args();
            if(count($args)==1){
                $this->setMemID($args[0]);
            }
        }

        private function setMemID($memID){
            $this->memID=$memID;
        }
        private function getMemID($memID){
            return $this->memID;
        }

        function getMember(){
            $mysqli=  connect();
            $query="
                select  *
                from    member
                where   memID='".$this->memID."'
                ";
            $result=  $mysqli->query($query);
            $row=  $result->fetch_array(MYSQLI_ASSOC);
            return $row;
        }

        function addMember($memberArr){
            $mysqli=  connect();
            $query="
                insert into member
                    (
                        cardID,
                        title,
                        firstName,
                        lastName,
                        mobile,
                        geoLocation,
                        coopID
                    ) values (
                        '".$memberArr["cardID"]."',
                        '".$memberArr["title"]."',
                        '".$memberArr["firstName"]."',
                        '".$memberArr["lastName"]."',
                        '".$memberArr["mobile"]."',
                        '".$memberArr["geoLocation"]."',
                        '".$memberArr["coopID"]."'
                    )
                ";
            $mysqli->query($query);
            return $mysqli->insert_id;
        }
    }